/*Author: Lubwama Samuel
 * Email:lubwamasamuel3@gmail.com
 */
package com.hbu.housingbrokerug.activities;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import android.app.Activity;
import android.graphics.Bitmap;
import android.util.Log;

import com.hub.R;
import com.nostra13.universalimageloader.core.DisplayImageOptions;

/**
 * 
 * @author Lubwama Samuel
 *
 */
public  final class parserFromUrl extends Activity{
	public parserFromUrl() {
	}
DisplayImageOptions options;
public String getIpOrDomain(){return "http://refugeedv.org/housingbrokerug/mobileobjects/";}
public String getDefaultImage(){return "images1/default.png";}
public String getQueryFile(){return "get_singleUnit.php";}
public String getPostFile(){return "add_comment.php";}

public String getQueryFileCategory() {
	// TODO Auto-generated method stub
	return "category.php";
}

public List<NameValuePair> getParametersAllData(){
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	return parameters;
	}
public List<NameValuePair> getParametersSingleUnit(String unit_id){
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("unit_id",unit_id));
	return parameters;
}
public List<NameValuePair> getParametersAllHousingUnits(String categoryId){
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("category_id",categoryId));
	Log.d("TAG", categoryId);
	return parameters;
}
// Parameters When in need getting Housing unit composition
public List<NameValuePair> getParametersSingleUnitComposition(String unit_id){
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("unit_id",unit_id));
	parameters.add(new BasicNameValuePair("get_unit_composition"," "));
	return parameters;
}

public List<NameValuePair> getParametersSingleUnitProximityTo(String unit_id){
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("unit_id",unit_id));
	parameters.add(new BasicNameValuePair("get_unit_proximity_to"," "));
	return parameters;
}

//Parameters When in need getting Housing unit Gallery
public List<NameValuePair> getParametersSingleUnitGallery(String unit_id){
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("unit_id",unit_id));
	parameters.add(new BasicNameValuePair("get_unit_gallery"," "));
	return parameters;
}

//Parameters When in need getting Housing unit Gallery
public List<NameValuePair> getParametersSingleUnitFeedBack(String serialNumber, String unit_id,String phone, String email, String comment,String ratting){
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("unit_id",unit_id));
	parameters.add(new BasicNameValuePair("phone",phone));
	parameters.add(new BasicNameValuePair("serial_number",serialNumber));
	parameters.add(new BasicNameValuePair("email",email));
	parameters.add(new BasicNameValuePair("ratting",ratting));
	parameters.add(new BasicNameValuePair("comment",comment));
	return parameters;
}

public DisplayImageOptions getOptions(){
		return options= new DisplayImageOptions.Builder()
		.showStubImage(R.drawable.ic_stub)
		.showImageForEmptyUri(R.drawable.ic_empty)
		.showImageOnFail(R.drawable.ic_error)
		.cacheInMemory()
		.cacheOnDisc()
		.bitmapConfig(Bitmap.Config.RGB_565)
		.build();	
}
public static class Extra {
		public static final String IMAGES = "com.nostra13.example.universalimageloader.IMAGES";
		public static final String IMAGE_POSITION = "com.nostra13.example.universalimageloader.IMAGE_POSITION";
}
public List<NameValuePair> getParametersSearch(String changedText,String categoryId) {
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("search",changedText));
	parameters.add(new BasicNameValuePair("category_id",categoryId));
	// TODO Auto-generated method stub
	return parameters;
}

public List<NameValuePair> getParametersSearchByPrice(String from, String to) {
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("from",from));
	parameters.add(new BasicNameValuePair("to",to));
	parameters.add(new BasicNameValuePair("byprice"," "));
	// TODO Auto-generated method stub
	return parameters;
}
public List<NameValuePair> getParametersSearchByLocation(String district, String city, String town, String village) {
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("district",district));
	parameters.add(new BasicNameValuePair("city",city));
	parameters.add(new BasicNameValuePair("town",town));
	parameters.add(new BasicNameValuePair("village",village));
	parameters.add(new BasicNameValuePair("bylocation", " "));
	// TODO Auto-generated method stub
	return parameters;
}

public List<NameValuePair> getParametersSearchByComposition(String composition) {
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("composition",composition));
	// TODO Auto-generated method stub
	return parameters;
}

public List<NameValuePair> getParametersGetGategoryType(String categoryType) {
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("category_type",categoryType));
	// TODO Auto-generated method stub
	return parameters;
}

public List<NameValuePair> getParametersSearchAdvanced(String district, String city, String town, String village, String composition, String from, String to) {
	List<NameValuePair> parameters=new ArrayList<NameValuePair>();
	parameters.add(new BasicNameValuePair("composition",composition));
	parameters.add(new BasicNameValuePair("district",district));
	parameters.add(new BasicNameValuePair("city",city));
	parameters.add(new BasicNameValuePair("town",town));
	parameters.add(new BasicNameValuePair("village",village));
	parameters.add(new BasicNameValuePair("from",from));
	parameters.add(new BasicNameValuePair("to",to));
	// TODO Auto-generated method stub
	return parameters;
}

}
